package com.mate.cloud.canal.client;


import lombok.Data;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
 * 配置类，对应于yml里面的配置
 * @email:          448341911@qq.com
 * @author:         MI
 * @createDate:
 * @updateUser:     MI
 * @updateDate:
 * @updateRemark:   修改内容
 * @version:        1.0
 */
@Data
@Configuration
@ConditionalOnProperty(value = "enabled", matchIfMissing = true)
@ConfigurationProperties(prefix = CanalProperties.PREFIX)
public class CanalProperties {

    public final static String PREFIX = "com.mate.canal";
    /**
     * cancal服务ip
     */
    private String hostname;

    /**
     * 端口
     */
    private Integer port = 11111;

    /**
     * 名字
     */
    private String destination = "example";

    /**
     * canal服务端用户名
     */
    private String username;
    /**
     * canal服务端密码
     */
    private String password;

    /**
     * 数据库表名过滤规则
     */
    private String filter;

    /**
     * 获取不到数据，休眠时间
     */
    private long sleepTime;

    /**
     * 一次取出多少条记录
     */
    private Integer batchSize = 1000;

}
